package com.xw.lianshou.xuexi.iostream;

import java.io.File;
import java.io.IOException;

public class IOTest {

    public static void main(String[] args) {
        //创建文件
        File file = new File("D:/ceshi/java/b.txt");
        if (!file.exists()){
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
//        String name = file.getName();
//        System.out.println(name);

        //创建文件夹
        File dir = new File("D:/ceshi/java/IO/");
        if (!dir.exists()){
            dir.mkdir();
        }
        // 创建多级文件夹
        File dirs = new File("D:/ceshi/java/net/socket/");
        if (!dirs.exists()){
            dirs.mkdirs();
        }
    }

}
